package com.home.moon.util;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;

import java.util.Date;

/**
 * @author 72492
 * JWT工具栏
 */
public class JWTUtil {
    /**
     * 获取token
     * @param audience
     * @param expiresAt
     * @param algorithm
     * @return
     */
    public static String getToken(String audience,Date expiresAt,Algorithm algorithm){
        String jwt = JWT.create()
                .withAudience(audience)
                .withExpiresAt(expiresAt)
                .sign(algorithm);
        return jwt;
    }
}
